//
//  MockupClientAppDelegate.m
//  MockupClient
//
//  Created by Christoph Eßer on 1/18/12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import "MockupClientAppDelegate.h"
#import "NetworkingCenter.h"

@implementation MockupClientAppDelegate

@synthesize window;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    // Insert code here to initialize your application
}

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
{
    return YES;
}

-(void)applicationWillTerminate:(NSNotification *)notification {
    //Nasty hack to make client cancel networking thread properly
    if([[NetworkingCenter defaultServer] isRunning]) {
        [[NetworkingCenter defaultServer] closeConnectionToServer];
    }
    sleep(1);
}


@end
